﻿using System.Collections.Generic;

namespace eCommerce.db.DataRespository
{
    public class PropertyEntity
    {
        public int PropertyId { get; set; }
        public string Name { get; set; }
        public int ParentId { get; set; }
        public int Priority { get; set; }
        public string SearchType { get; set; }
        
        public List<PropertyEntity> LargePropertySearch { get; set; }
        public List<PropertyEntity> SmallPropertySearch { get; set; }
        
        private readonly Dictionary<string, object> _extendedProperties = new Dictionary<string, object>();
        public object this[string propertyName]
        {
            get
            {
                return (_extendedProperties.ContainsKey(propertyName) ? _extendedProperties[propertyName] : null);
            }
            set
            {
                if (_extendedProperties.ContainsKey(propertyName))
                {
                    _extendedProperties[propertyName] = value;
                }
                else
                {
                    _extendedProperties.Add(propertyName, value);
                }
            }
        }
    }
}
